package com.bytz.modules.cms.order.constants;

import com.bytz.modules.bpm.client.model.BizFlowProperty;
import com.bytz.modules.cms.order.constant.OrderConstants;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

/**
 * @program: cms-backend
 *
 * @description:
 *
 * @author: KyleWang
 *
 * @create: 2022-10-25 11:25
 **/

public class OrderFlowConstants {

    public static class OrderFlowProperty {
        public static final Set<String> status = new HashSet<>(Arrays.asList(
                OrderConstants.OrderStatus.SHEN_HE_ZHONG,
                OrderConstants.OrderStatus.SHEN_HE_TONG_GUO

        ));
        public static final String FLOW_KEY = "cms_order";
        public static final BizFlowProperty ORDER_PROPERTY = BizFlowProperty.builder()
                .processKey(FLOW_KEY)
                .participantTableName("cms_order_part")
                .startStatus(OrderConstants.OrderStatus.SHEN_HE_ZHONG)
                .endStatus(OrderConstants.OrderStatus.SHEN_HE_TONG_GUO)
                .terminateStatus(OrderConstants.OrderStatus.YI_ZHONG_ZHI)
                .processEndCallBack(false)
                .build();

    }

    public static class EcFlowProperty {

        public static final String AUDIT_ROLE = "ECManager";
        public static final Set<String> status = new HashSet<>(Arrays.asList(
                OrderConstants.EcStatus.UNCOMMITTED,
                OrderConstants.EcStatus.APPROVING,
                OrderConstants.EcStatus.REJECT,
                OrderConstants.EcStatus.CHECKED
        ));
        public static final BizFlowProperty EC_PROPERTY = BizFlowProperty.builder().processKey("cms_order_ec")
                .processEndCallBack(false)
                .statusSet(status)
                .startStatus(OrderConstants.EcStatus.APPROVING)
                .rejectStatus(OrderConstants.EcStatus.REJECT)
                .endStatus(OrderConstants.EcStatus.CHECKED)
                .terminateStatus(OrderConstants.EcStatus.TERMINATED)
                .build();

    }

    public static class OrderAssigneeConstants {
        public static class Parameters {
            public static final String ROLE_ID = "roleId";
            public static final String ROLE_NAME = "roleName";
            public static final String ROLE_CODE = "roleCode";
            public static final String TYPE = "type";
            public static final String TYPE_DEPT = "dept";
            public static final String TYPE_AREA = "area";
            public static final String DEPT_NAME = "deptName";
            public static final String DEPT_Id = "deptId";


        }

    }


}